import store from '@/store';

export function clearCurrentRoute() {

}

export function getComponentName(to, callback) {
  let matched = to.matched || [];
  matched = matched[matched.length - 1];
  let comp = matched.components.default;
  if (comp instanceof Function) {
    comp().then(c => {
      callback(c.default.name)
    });
  } else {
    callback(comp.name);
  }
}